package com.coocaa.launcher.wallpaper;

import android.os.Bundle;

import com.coocaa.launcher.LauncherBaseActivity;
import com.coocaa.x.framework.utils.LogUtils;

/**
 * Created by luwei on 15-7-4.
 */
public class WallpaperActivity extends LauncherBaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(new WallpaperLayout(this));
        showLoading();
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (WallpaperManager.getInstance().getChangeSuccess())
            finish();
        else {
            WallpaperController.getInstance(this).resume();
        }
    }

    @Override
    protected void onPause() {
        super.onPause();
        WallpaperController.getInstance(this).pause();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        LogUtils.d("wallpaper", "ondestory");
        WallpaperController.getInstance(this).destory();
        WallpaperManager.getInstance().setChangeSuccess(false);
    }
}
